package cn.iocoder.yudao.module.ride.dal.mysql.bindlog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ride.dal.dataobject.bindlog.BindLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ride.controller.admin.bindlog.vo.*;

/**
 * 车辆绑定/解绑记录 Mapper
 *
 * @author 小胡同学
 */
@Mapper
public interface BindLogMapper extends BaseMapperX<BindLogDO> {

    default PageResult<BindLogDO> selectPage(BindLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BindLogDO>()
                .likeIfPresent(BindLogDO::getDriverName, reqVO.getDriverName())
                .eqIfPresent(BindLogDO::getPlateNo, reqVO.getPlateNo())
                .eqIfPresent(BindLogDO::getTotalMileage, reqVO.getTotalMileage())
                .orderByDesc(BindLogDO::getId));
    }

}